package com.catsic.practice.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author: owen
 * @CreateTime: 2025-05-30  14:09
 * @Description:
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result<T>{
    private int code;
    private String msg;
    private T data;

    public static <T> Result<T> success(T data){
        return new Result<>(200,"success",data);
    }

    public static <T> Result<T> success(){
        return new Result<>(200,"success",null );
    }
    public static <T> Result<T> error(T data){
        return new Result<>(500,"error",data);
    }
}
